|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcontent.Vehicle
public class Vehicle
Vehicle class is a structure of basic attributes for any vehicle. This class uses Color class to implement any possible vehicle colour.
Color| Constructor Summary | |
|---|---|
Vehicle(int licensePlate,
int year,
EngineType engineType,
Chassis chassis,
java.lang.String model,
java.awt.Color colour,
int numDoors)
This method is a constructor for vehicle class. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares two Vehicles for equality by License Plate number |
Chassis |
getChassis()
This method returns vehicle's chassis name from possible options of the enum class. |
java.lang.String |
getColour()
This method checks if colour is not null. |
EngineType |
getEngineType()
This method contains vehicle's engine type from a possible options of the enum class. |
int |
getLicensePlate()
This method |
java.lang.String |
getModel()
This method |
int |
getNumDoors()
This method |
int |
getYear()
This method |
int |
hashCode()
The method creates hash indexes for hashTable by activating hashCode on primary fields. |
void |
setChassis(Chassis chassis)
This method allows to update chassis for this vehicle. |
void |
setColour(java.awt.Color colour)
The method updates the colour of the vehicle, after the input colour is checked and it is one of the legal colours. |
void |
setEngineType(EngineType engineType)
This method allows to update engineType for this vehicle. |
java.lang.String |
toString()
The method @return a string representation of a Vehicle. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vehicle(int licensePlate,
int year,
EngineType engineType,
Chassis chassis,
java.lang.String model,
java.awt.Color colour,
int numDoors)
year - manufacturer - model - colour - numDoors - | Method Detail |
|---|
public int getYear()
public java.lang.String getColour()
public void setColour(java.awt.Color colour)
colour - public java.lang.String getModel()
public int getNumDoors()
public int getLicensePlate()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectgetLicensePlate()public java.lang.String toString()
toString in class java.lang.Objectpublic Chassis getChassis()
Chasis#javapublic void setChassis(Chassis chassis)
chassis - public EngineType getEngineType()
engineType#javapublic void setEngineType(EngineType engineType)
engineType -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||